package org.dromara.common.core.exception.wvp;

import org.dromara.common.core.enums.ErrorCode;
import org.dromara.common.core.exception.base.BaseException;

import java.io.Serial;

/**
 * 自定义异常，controller出现错误时直接抛出异常由全局异常捕获并返回结果
 *
 * @author 37661
 */
public class ControllerException extends BaseException {
    @Serial
    private static final long serialVersionUID = 1L;

    public ControllerException(Integer code, Object... args) {
        super(args[0].toString());
    }

    public ControllerException(ErrorCode error400) {
        super(String.valueOf(error400.getMsg()));
    }
}
